home *** CD-ROM | disk | FTP | other *** search
- Path: news.ner.bbnplanet.net!forest!ebromber
- From: ebromber@forest.drew.edu
- Newsgroups: comp.lang.c
- Subject: Programming Question
- Message-ID: <1996Mar3.164754.137341@forest>
- Date: 3 Mar 96 16:47:54 EST
- Organization: Drew University
-
- Below is part of the code for a password program which I wrote. However,
- wheneve I run the program, the "ENTER PASSWORD HERE" only appears after a
- carriage return is entered. In other words, I have to type the password in
- before it prints that message. If I hit return, it accepts that as the
- password. I wrote this program on a pc and used a MS-DOS compiler. Does
- anyone know why and how I can fix this?
-
- Thanks in advance.
- ebromber@drew.edu
-
- PARTIAL CODE
- int pass[100];
- int count=0;
- char ch;
- printf("ENTER PASSWORD HERE: ");
- while (ch=getch() !='\n')
- { pass[count]=ch;
- putch('*');
- count++;
- }
-